home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / CIncludes / ToolUtils.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  3.4 KB  |  172 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ToolUtils.h
  3.  
  4.      Contains:    Toolbox Utilities Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1990-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __TOOLUTILS__
  18. #define __TOOLUTILS__
  19.  
  20. #ifndef __MACTYPES__
  21. #include <MacTypes.h>
  22. #endif
  23. #ifndef __OSUTILS__
  24. #include <OSUtils.h>
  25. #endif
  26.  
  27. #if OLDROUTINELOCATIONS
  28. #ifndef __FIXMATH__
  29. #include <FixMath.h>
  30. #endif
  31. #ifndef __ICONS__
  32. #include <Icons.h>
  33. #endif
  34. #ifndef __QUICKDRAW__
  35. #include <Quickdraw.h>
  36. #endif
  37. #ifndef __TEXTUTILS__
  38. #include <TextUtils.h>
  39. #endif
  40. #endif  /* OLDROUTINELOCATIONS */
  41.  
  42.  
  43.  
  44. #if PRAGMA_ONCE
  45. #pragma once
  46. #endif
  47.  
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51.  
  52. #if PRAGMA_IMPORT
  53. #pragma import on
  54. #endif
  55.  
  56. #if PRAGMA_STRUCT_ALIGN
  57.     #pragma options align=mac68k
  58. #elif PRAGMA_STRUCT_PACKPUSH
  59.     #pragma pack(push, 2)
  60. #elif PRAGMA_STRUCT_PACK
  61.     #pragma pack(2)
  62. #endif
  63.  
  64.  
  65. /*
  66. ————————————————————————————————————————————————————————————————————————————————————
  67.     Note: 
  68.     
  69.     The following routines that used to be in this header file, have moved to
  70.     more appropriate headers.  If OLDROUTINELOCATIONS is 0, then you will have
  71.     to include the headers below to use the following functions.
  72.     
  73.         FixMath.h:        FixMul
  74.                         FixRatio
  75.                         FixRound
  76.         
  77.         Icons.h:          GetIcon
  78.                         PlotIcon
  79.                         
  80.         Quickdraw.h:    AngleFromSlope
  81.                         DeltaPoint
  82.                         GetCursor
  83.                         GetIndPattern
  84.                         GetPattern
  85.                         GetPicture
  86.                         PackBits
  87.                         ScreenRes
  88.                         ShieldCursor
  89.                         SlopeFromAngle
  90.                         UnpackBits
  91.                         
  92.         TextUtils.h:    Munger
  93.                         GetIndString
  94.                         GetString
  95.                         NewString
  96.                         SetString
  97. ————————————————————————————————————————————————————————————————————————————————————
  98. */
  99.  
  100.  
  101. EXTERN_API( Boolean )
  102. BitTst                            (const void *            bytePtr,
  103.                                  long                     bitNum)                                ONEWORDINLINE(0xA85D);
  104.  
  105. EXTERN_API( void )
  106. BitSet                            (void *                    bytePtr,
  107.                                  long                     bitNum)                                ONEWORDINLINE(0xA85E);
  108.  
  109. EXTERN_API( void )
  110. BitClr                            (void *                    bytePtr,
  111.                                  long                     bitNum)                                ONEWORDINLINE(0xA85F);
  112.  
  113. EXTERN_API( long )
  114. BitAnd                            (long                     value1,
  115.                                  long                     value2)                                ONEWORDINLINE(0xA858);
  116.  
  117. EXTERN_API( long )
  118. BitOr                            (long                     value1,
  119.                                  long                     value2)                                ONEWORDINLINE(0xA85B);
  120.  
  121. EXTERN_API( long )
  122. BitXor                            (long                     value1,
  123.                                  long                     value2)                                ONEWORDINLINE(0xA859);
  124.  
  125. EXTERN_API( long )
  126. BitNot                            (long                     value)                                ONEWORDINLINE(0xA85A);
  127.  
  128. EXTERN_API( long )
  129. BitShift                        (long                     value,
  130.                                  short                     count)                                ONEWORDINLINE(0xA85C);
  131.  
  132. #if TARGET_CPU_68K
  133.  
  134. struct Int64Bit {
  135.     SInt32                             hiLong;
  136.     UInt32                             loLong;
  137. };
  138. typedef struct Int64Bit                    Int64Bit;
  139. EXTERN_API( void )
  140. LongMul                            (long                     a,
  141.                                  long                     b,
  142.                                  Int64Bit *                result)                                ONEWORDINLINE(0xA867);
  143.  
  144. #else
  145.     #define LongMul(a, b, result) ((void) WideMultiply((a), (b), (wide*)(result)))
  146. #endif  /* TARGET_CPU_68K */
  147.  
  148. #define HiWord(x) ((short)((long)(x) >> 16))
  149. #define LoWord(x) ((short)(x))
  150.  
  151.  
  152. #if PRAGMA_STRUCT_ALIGN
  153.     #pragma options align=reset
  154. #elif PRAGMA_STRUCT_PACKPUSH
  155.     #pragma pack(pop)
  156. #elif PRAGMA_STRUCT_PACK
  157.     #pragma pack()
  158. #endif
  159.  
  160. #ifdef PRAGMA_IMPORT_OFF
  161. #pragma import off
  162. #elif PRAGMA_IMPORT
  163. #pragma import reset
  164. #endif
  165.  
  166. #ifdef __cplusplus
  167. }
  168. #endif
  169.  
  170. #endif /* __TOOLUTILS__ */
  171.  
  172.